{% extends "base.html" %}
{%block title%}math{%end%}
{%block main%}

<script type="text/javascript" src="{{static_url("ASCIIMathML.js")}}"></script>
<textarea id="in" rows="3" cols="40" onkeyup="calculate('in','out')"></textarea>
<span id="out"><math title=" ="><mstyle displaystyle="true"
fontfamily="serif"
mathcolor="blue"><mn></mn><mo>=</mo></mstyle></math></span>

<button id="math_submit">Submit</button>

<textarea id="calc" style="display:none;">  </textarea>

<script>
   $(document).ready(function(){
       $('#math_submit').click(function () {
           $.get('/mathparse', {'text': $('#in').val()}, function (data) {
           $('#calc').show();     
           $('#calc').val(data);
	   console.log(data);
           });
       });
   });
</script>

<p>MathXL javascript by Peter Jipsen http://www.chapman.edu/~jipsen</p>

{% end %}
